package Day2025_03_26;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Demo01 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        long x = in.nextLong();
        List<Character> s = new ArrayList<>();
        int count = 0, tmp = 0;
        while (x != 0) {
            s.add((char)(x % 10 + '0'));
            count++;
            tmp++;
            if (tmp % 3 == 0) {
                s.add(',');
                count++;
            }
            x /= 10;
        }
        Collections.reverse(s);
        StringBuffer ret = new StringBuffer();
        for (Character ch : s) ret.append(ch);
        String ss = ret.toString();
        if (ss.charAt(0) == ',') ss = ss.substring(1, count);
        else ss = ss.substring(0, count);
        System.out.println(ss);
    }
}
